public class code2 {
    public static void main(String[] args) {
        String str = "14444112442aa44442244311222222244445444243334444ccc4444";
        repeat(str);
    }

    public static void repeat(String str) {

        char ret = 0;
        int retCount = 0;
        int count = 1;
        char cur = str.charAt(0);
        for(int i=1;i<str.length();i++) {
            if(cur == str.charAt(i)) {
                count++;
            } else {
                //更新结果
                if(count > retCount) {
                    ret = cur;
                    retCount = count;
                }
                count = 1;
                cur = str.charAt(i);
            }
        }
        System.out.println(ret + " " + retCount);
    }
}
